Shared data and clock recovery for packetized data

ABSTRACT

A shared data and clock recovery circuit including a clock synthesizer for generating sampling signals having different phases, a multiple transition detector for receiving a data stream and sampling signals, and for detecting edges in a data stream in response to the sampling signals, a counter and accumulator for detecting the time occurrences and total number of edges, and for performing weighted average calculation to select one of the phases, a decision circuit for detecting the phase difference between a source clock and a local clock such that if the PPM difference between the source clock and the local clock is at least 200 PPM, then selection of a phase is based upon stored historical information, and if the PPM difference between the source clock and the local clock is less than 200 PPM, then selection of a phase is based on a weighted averaging calculation.

CROSS-REFERENCES TO RELATED PATENT APPLICATIONS

This application claims the benefit of U.S. Provisional Patent Application Serial No. 60/087,606, filed Jun. 1, 1998.

This patent application incorporates herein by reference U.S. patent application Ser. No. 09/323,170, filed May 27, 1999 entitle “Shared Data and Clock Recovery Using Edge Sampling Technique” and U.S. patent application Ser. No. 09/322,112, filed May 27, 1999 entitled “Data Recovery for Non-Uniformly Spaced Edges.”

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates generally to high-speed digital data transmission systems and more specifically to a circuit and method for data recovery for non-uniformly spaced data.

2. Description of the Background Art

In conventional digital communication systems, electronic information is transferred between a transmitting unit and a receiving, unit over a communications channel, such as a transmission line. The electronic information is commonly transmitted in the form of data bits, with each bit being a binary “0” (hereinafter simply “0”) or a binary “1” (hereinafter simply “1”). The “0” and “1” values can, for example, represent low and high voltages, respectively.

The transferred electronic information is further characterized by a fundamental bit rate, i.e., the clock frequency of the data bits. In synchronous transmission typically used in computer-to-computer communication, for example, the receiving unit determines the clock frequency of the transmitting unit (e.g., for decoding purposes) by deriving a clock signal from timing information of the transmitted data bits. This process is known as clock recovery. The recovered clock signal enables the receiving unit to optimally sample the received digitally encoded electronic information during the decoding process.

Clock recovery circuits are commonly employed, for example, in conjunction with Local Area Networks (LANs) and point-to-point communication links. A conventional clock recovery circuit typically employs phase-locked loops (PLLs). A typical PLL has a voltage-controlled-oscillator (VCO) whose phase will lock onto a frequency component of the PLL input signal from the destination clock generator. The PLL also has a phase detector for comparing the phase of the VCO with the phase of the PLL input signal, and for developing a voltage proportional to the phase differential, which commonly is referred to as a “phase error.” This voltage is filtered and applied as a control voltage to the VCO to adjust the VCO's frequency. Due to negative feedback, the phase error is driven to a preferably small value, and the VCO's frequency consequently becomes equal to the PLL input frequency. PLL circuits are further shown and described in Best, R. E., Phase-Locked Loops Theory, Design, and Application, McGraw-Hill Book Company, New York, N.Y. (1993); Razavi, Behzad, Monolithic Phase-locked Loops and Clock Recovery Circuits, Theory and Design, IEEE Press, New York, N.Y. (1996); Gardner, Floyd M., Phaselock Techniques, John Wiley & Sons (1979); and Haung, H. M., Banatao, D., Perlegos, G., Wu, T. C., and Chiu, T. L., A CMOS Ethernet Serial Interface Chip, IEEE International Solid-State Circuits Conference Digest (1984).

Data and clock recovery circuits using the “one-shot” method are shown and described in Bell, A. G., Borriello, G., A Single Chip NMOS Ethernet Controller, IEEE International Solid-State Circuits Conference Digest (1983), which is incorporated herein by reference. Clock and data recovery circuits are also shown and described in U.S. Pat. No. 5,056,118 issued to Sun on Oct. 8, 1991; U.S. Pat. No. 5,103,466 issued to Bazes on Apr. 7, 1992; in U.S. Pat. No. 5,164,966 issued to Hershberger on Nov. 17, 1992; U.S. Pat. No. 4,853,943 issued to Laws on Aug. 1, 1989; and U.S. Pat. No. 4,841,257 issued to Morrison et al. on Jun. 20, 1989.

Various analog approaches exist for data and clock recovery. For example, in U.S. Pat. No. 5,124,669 to Palmer et al., a clock recovery circuit using a PLL is shown and described. A one-shot circuit is coupled to the PLL to enable the phase detector when the data stream does not consist of uniformly spaced pulses. Without a one-shot circuit, the phase detector in the PLL generates a large error signal whenever a clock pulse occurs without a data pulse. During the times when the phase detector is enabled, a phase comparison is made between the next data pulse edge and the next clock pulse edge. When this comparison is completed, the phase detector is disabled again. In order for the PLL to average out the effects of noise and jitter, the phase detector is enabled at one half of a clock period before the data edge. By doing this, the data edge can shift up to one half of a clock period before the phase detector generates an incorrect error signal. If the data edge is shifted further than one half of a clock period, then the data edge is compared to a different rising clock edge and the detector generates an error. The one-shot circuit has been designed to generate a delayed data signal whose rising edge is used to enable the phase detector, and whose falling edge is compared with the clock edge for disabling the phase detector.

However, the circuit of Palmer would cause erroneous data and/or clock recovery if a data stream edge (transition) does not occur within a significant time length, such as 60 bit times. In addition, PLLs in conventional data and clock recovery systems tend to drift if an edge-starved pattern (a period of time when the number of data edges is far below the expected or average number of edges) appears in the data stream. This drift causes the PLL to become out of phase with the source clock phase and frequently results in erroneous data recovery.

Traditional PLLs tend to drift in edge-starved situations due to either too much gain resulting in too much or too little gain resulting in too slow a response. In the prior art, edge-starvation has been dealt with by reducing the loop gain and accepting a slower response in order to avoid the instability of over-correction resulting from high loop gain.

Additionally, wobble (where high jitter levels exist in the data and the PLL gain cannot be sufficiently controlled) can occur in analog PLL approaches to clock and data recovery. Jitter is typically a result of instantaneous noise injection in the communications system, or a result of transmission cable imperfections, or a result of source clock imperfections, and/or a result of other electrical behavioral characteristics. Conventional PLL-based clock/data recovery systems tend to lock on the jittered bits and accordingly perform unnecessary phase adjustments. This tendency causes a traditional PLL to go out of phase with the source clock phase during periods of edge-starvation.

Thus, what is needed is a novel data and clock recovery circuit and method that will overcome the foregoing deficiencies.

SUMMARY OF THE INVENTION

An object of the present invention is to provide a clock frequency tracking mechanism which will more closely track the actual clock frequency used in a network. The invention has the advantage of using the PLL with a reduced sensitivity that meets the needs of tracking the clock frequency of a network.

The shared data and clock recovery circuit includes a source clock, a destination clock, a clock synthesizer for generating sampling signals having different phases, a multiple transition detector for receiving a data stream and sampling signals, and for detecting edges in the data stream using sampling signals, a counter/accumulator for detecting the time occurrences and total number of edges, and for performing a weighted averaging calculation and outputting a signal reflecting the weighted averaging to select one of the different phases, and a circuit to track and digitally store the difference between the source clock and the destination clock.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a digital communications system.

FIG. 2 shows one embodiment of a data and clock recovery circuit.

FIG. 2A illustrates a data and clock recovery circuit useful with pocketized data systems.

FIG. 2B illustrates a data and clock recovery circuit useful with packetized data systems.

FIG. 3 shows another embodiment of a data and clock recovery circuit.

FIG. 4 shows a phase-locked loop that is one embodiment of a clock synthesizer according to the present invention.

FIG. 5 shows one example of a multiple transition detector circuit according to the present invention.

FIG. 6 shows a schematic logic diagram of the edge counter and phase accumulator module 210 for performing the weighted averaging function.

FIG. 7 is a pseudo-code listing indicating operation of the phase accumulator module.

FIG. 8 shows a state diagram for decision circuit used for acquiring lock onto an incoming pocketized data stream in accordance with a preferred embodiment of the present invention.

FIG. 9 is a diagram and computation illustrating an example of an input signal having edges corresponding to certain bin positions of a 40 bin system.

FIG. 10 is a diagram of a computation illustrating a folded system.

FIG. 11 shows the operation of the invention and the method for clock recovery based on edge sampling and weighted-averaging.

FIG. 12 shows each bin BIN0 . . . BIN15.

FIG. 13 shows each bin in the BIN0 . . . BIN15 configuration and how the sampling is centered around BIN8.

FIG. 14 shows a DATA signal for further illustrating the method of sampling based on weighted averaging.

FIG. 15 shows how jitter may occur in the DATA signal, causing a bit to shift and how the calculated weighted average value takes into account the bit distributions of the DATA signal and maintain sampling at the bit midstream position.

DETAILED DESCRIPTION OF THE INVENTION

The invention has several advantages. It is easy to change and port new digital recovery algorithms. It results in a circuit complexity and area reduction by a factor of three from the prior art circuits. Additionally, a power and chip area reduction is achieved in receiving multiple channels by not requiring multiple copies of the clock synthesizer circuitry. Only the logic state machine portion needs to be replicated for multiple channel applications.

FIG. 1 shows an exemplary digital communications system, 100 which includes a transmitting unit or node 110 coupled by a transmission channel 115 to a receiving unit or node 120. The transmitting unit 110 includes a data generator and encoder 112 for generating the data stream 125 across the transmission channel 115. In addition, a source clock 114 is connected to the data generator and encoder 112 for providing timing information to the data stream 125.

The transmission channel 115 is typically unshielded twisted pair wiring, but may also be shielded twisted pairs, attachment unit interface (AUI) cables, copper distributed data interface (CDDI), coaxial transmission lines, or other types of wiring. Additional details on CDDI (FDDI) are discussed in Fibre Distributed Data Interface (FDDI)—Part: Token Ring Twisted Pair Physical Layer Medium Dependent (TP-PMD), American National Standard For Information Systems (Mar. 1, 1995) and in U.S. Pat. No. 5,305,350 to Budin et al. on Apr. 19, 1994, all are fully incorporated herein by reference.

The data stream 125 may, for example, have non-return-to-zero inverted (NRZI) encoding or non-return-to-zero (NRZ) encoding. As known to those skilled in the art, NRZI and NRZ coding do not contain imbedded clock signals. Alternatively, the data stream 125 may be phase encoded (i.e., data containing imbedded clock signals). Additional details on the several types of phase encoding schemes are shown and described in the above Bazes patent, fully incorporated herein by reference. Phase encoding schemes include the following: (i) bi-phase-level encoding (“Manchester encoding”), (ii) bi-phase-mark encoding (frequency-modulation or FM), (iii) delay-modulation (“Miller encoding” or Modified FM (MFM)), and (iv) amplitude multi-level coding (MLT3). Manchester encoded waveforms are shown and described in the above Laws patent, fully incorporated herein by reference.

The data stream 125 is susceptible to being corrupted to varying degrees after propagating across the transmission channel 115 due to additive noise, inter-symbol interference (ISI), and/or jitter. In the receiving unit 120, an equalizer (not shown in FIG. 1) receives the transmitted signal 125 for generally reducing ISI and for compensating for amplitude and phase distortion introduced in transmission.

The data stream 125 is received by the data and clock recovery circuit 130 in accordance with the present invention. Preferred embodiments 130 a, 130 b and 130 c of this data and clock recovery circuit 130 are shown in additional detail in FIGS. 2, 2A and 3, respectively. The data and clock recovery circuit 130 outputs the recovered data via line 135 and the recovered clock signal via line 140. Additionally, a destination (or local) clock 145 functions with the data and clock recovery circuit 130 in the clock recovery of the data stream 125.

FIG. 2 shows a data and clock recovery circuit 130 a. A clock synthesizer 200 is connected to the destination clock 145 and outputs n-equally spaced clock edges/cycles (or sampling signals) S0 . . . Sn−1 to a sampling circuit 202. The sampling circuit 202 also receives the data stream 125 and includes a multiple transition detector 205 coupled to an edge counter and sum accumulator 210. The multiple transition detector 205 receives the clock edges S0 . . . Sn−1 and the data stream 125. Conventional transition detectors are also shown and described in U.S. Pat. No. 5,276,712 to Pearson and fully incorporated herein by reference.

Upon receiving the data stream 125 and the n-equally spaced clock edges S0 . . . Sn−1 (from the clock synthesizer 200), the multiple transition detector 205 outputs the Bin(0) . . . Bin(n−1) signals to the counter/accumulator 210. The counter/accumulator 210 then performs weighted averaging of the signals Bin(0) . . . Bin(n−1), and outputs (to a decision circuit 215) a binary number representing the relative position of the incoming data with respect to the current position, which is the currently selected phase of the n-phase clock synthesizer. Based on this binary number, the decision circuit 215 outputs a “phase select” signal to a clock select circuit 217. In response to the “phase select” signal, the clock select circuit 217 selects one of the clock edges S0 . . . Sn−1 and outputs the selected clock edge as a recovered clock signal to a data decoder 220 so that data recovery is performed. The data decoder 220 also receives the data stream 125. The recovered data is then generated via line 135 to a subsequent circuitry stage 225.

Those skilled in the art will realize that certain implementations of the multiple transition detector 205 will require a re-synchronization circuit to be implemented in the data and clock recovery circuits 130 a, 130 b and 130 c.

FIG. 2A illustrates a data and clock recovery circuit for packetized data flow.

FIG. 3 shows a data and clock recovery circuit 130 c according to another embodiment of the present invention. In this embodiment, the data decoder 220 receives the sampled data 125 from the sampling circuit 202.

FIG. 4 shows a phase-locked loop 200 a, a preferred embodiment of a clock synthesizer 200 (of FIGS. 2, 2A and 3), which includes a phase comparator 300, a charge pump 305, a low pass filter 310, a voltage-controlled oscillator (VCO) 315, and a divider (or divide-by-n circuit) 320. As known to those skilled in the art, the divider 320 is an optional component of the phase-locked loop 200 a. Examples of divide-by-n circuits are also discussed in Horowitz, Paul and Hill, Winfield, The Art Of Electronics (2^(nd) ed.), Cambridge University Press, New York, N.Y. (1996); and in Giacoletto, L. J. (editor), Electronics Designers' Handbook (2^(nd) ed.), McGraw-Hill Book Company, New York, N.Y. (1977), all fully incorporated herein by reference. The phase comparator circuit 300 compares the f_(comp) frequency generated by the divider 320 to the f_(in) frequency generated by the destination clock 145. As a result of this comparison, the phase comparator 300 outputs the appropriate voltage to the charge pump 305 such that the VCO 315 can accordingly increase or reduce the oscillating frequency f_(out). The phase-locked loop 200 a eventually causes the f_(comp) and f_(in) to reach the same value at a certain point in time. If so, the VCO 315 becomes stable. As shown in FIG. 3, the VCO 315 also generates the n-equally-spaced clock edges (sampling signals) S0 . . . Sn−1 (of FIG. 2A and 2B). Other examples of circuits or systems which may be used as clock synthesizers 200 include, but not limited to, delay lock loops, RC delay networks, and precision delay lines.

FIG. 5 shows one example of a multiple transition detector circuit 205 according to the present invention. The multiple transition detector circuit 205 includes a plurality of sampling flip-flops 400 a, 400 b, . . . 400 n. Additional sampling flip-flops may be added in the multiple transition detector circuit 205 based on the networking scheme used and on design requirements. For example, a ten-megabit networking scheme will require additional flip-flops for the multiple transition detector circuit 205. Each of the flip-flops 400 a . . . 400 n receives the data stream 125 and the respective edges (sampling signals) S0 . . . Sn−1. The multiple transition detector circuit 205 also includes the Exclusive-OR (XOR) gates 410 a . . . 410 n. Additional XOR gates may be added in the multiple transition detector circuit 205 if additional flip-flops are implemented.

As shown in FIG. 5, the XOR gate 410 a has its first input terminal connected to the output terminal of the flip-flop 400 a and its second input terminal connected to the output terminal of the flip-flop 400 b. The XOR gate 410 b has its first input terminal connected to the output terminal of the flip-flop 400 b and its second input terminal connected to the output terminal of the flip-flop 400 c. The other XOR gates are similarly connected. The flip-flops 400 a . . . 400 n generate the sampled signals, VL0 . . . VLn, respectively.

The XOR gates 410 a . . . 41 n have output terminal connected to the edge counter and sum accumulator 210 (FIGS. 2, 2A and 3) for outputting the signals Bin(0) . . . Bin(n−1), respectively. FIG. 5 illustrates only a portion of the multiple transition detector circuit 205 to avoid overcrowding the diagram. Additional flip-flops and XOR gates are included in the circuit 205 and are represented by ellipses shown in FIG. 5.

FIG. 6 illustrates the sum accumulator 210 for performing the weighted averaging function.

FIG. 7 lists pseudo-code for operating the accumulator.

FIG. 8 shows a state diagram for the decision circuit function 215 for pocketized data signals. Twenty phases of 20 MHz are provided for sampling non-recovered clock and data. Five gain states are provided from zero phase to low gain. Zero phase start-up is based on 40 bins. A relative weighted average algorithm is provided. This system provides register programmability, sample size for each gain stage, lock count for each gain stage, relative data bin selection, and control for observable outputs. The gain control state definitions are as follows: Zero phase start-up (1) is a Jump to calculated phase based on 2 edges of absolute 40 bin. High gain forty (2*) is a register programmable Move up to one bin left or right based on 2* edges of relative 40 bin. High gain (4*) is a register programmable Move up to one bin left or right based on 2* edges of relative 20 bin. Medium gain (2*) is a register programmable Move up to one bin left or right based on 8* edges of relative 20 bin. Low gain (until end of packet) is a Move up to one bin left or right based on 16* edges of relative 20 bin.

Acquisition of Lock with a Decision Circuit

If the data stream is in the form of packets, the clock and data recovery algorithm has the added challenge of acquiring lock to the incoming data stream within a small number of bit times. The contents of the packet can be categorized into four types, preamble, start of frame, data, and end of packet. The characteristics of the preamble and the added edge displacement due to jitter, within certain bounds, are used by the clock and data recovery algorithm to accurately determine the lock position. Described in this invention is a process of how the acquisition of lock is obtained.

The process of lock acquisition is to progressively refine the location of the recovered clock based on the location of the edges that exist in the data stream. The gain control flowchart represents this process. Each box in the flowchart represents a gain stage. Each gain stage controls the sample size, the size of the sample window, and the maximum step size. Between each gain stage there exists a count that controls the amount of iterations that occur at each gain stage. At the start of packet, the first N1 edges are received and an absolute bin location is calculated based on a sample window of 2× the number of bins. The new phase, which during the idle time is the reference phase (i.e., phase 0), is changed to the bin location that was calculated based in the first N1 edges. Once the zero phase stage is completed, the gain control enters into the high2× gain stage. The number of edges evaluated to compute the weighted average is N2 and the maximum step size is S2. The weighted average calculation is based on a sample window that is still 2× however a relative weighted average calculation is now performed. Progression to the high gain stage occurs after L2 iterations of the high2× gain stage. After the zero phase start-up and the high2× gain stage, the clock recovery has chosen a phase position that is within ±45 degrees of the idle lock position. After the phase position is within this range of lock, the algorithm can begin collecting edge information based on 1× number of bins. The remaining gain stages progressively increase the edge counts (Nj) and reduce the maximum step size until the low gain stage is reached. At the low gain stage the edge count is at its largest value and the step size is equal to one bin. It is viewed at this point that the acquisition of lock has completed and movements from this position should only be for tracking PPM and not reaction to jitter. The gain control sum will remain in this stage until the end of packet is detected where the algorithm returns to idle waiting for the start of the next packet. Also note that the criteria for evaluation of the weighted average within each gain stage may be a function of both time and number of edges. For example, there may exist a data stream that has periods where there exists fewer edges. The evaluation of the weighted average would occur at set time intervals as long as the number of edges meets a minimum requirement.

Folded Sample Window with the Phase Accumulation and Decision Circuit

The number of bins (nb) required is a function of the bit time (bt), or data rate, and the phase resolution (dt), which determines the granularity of the recovery system. Therefore, the nb=bt/dt (i.e., 10 Mb data rate: bt=100 ns dt=2.5 ns nb=40).

This window size along with the preamble pattern allow for the recovery algorithm to determine the clock position with ±45 degrees of the idle clock position. Once within this ±45 degrees area the algorithm may be folded in half, reducing the number of bins in half. Therefore, if the system can remain folded with only a small amount of additional hardware, a great improvement of both power and area can be achieved. The reason for the power and area savings is due to the reduction in the number of phases, bins, width of accumulator, etc. Refer to FIG. 10 (folded window) for examples of bin calculation for 40 bins versus 20 bins.

FIG. 9 illustrates a 40 bin phase acquisition system and FIG. 10 illustrates a folded system.

Reference is now made to FIG. 11 for the operation of the invention and the method for clock recovery based on edge sampling and weighted-averaging. The upper signal, DATA 125, represents the data stream 125. Assuming the DATA 125 signal is NRZ or NRZI encoding, the multiple transition detector 205 (FIG. 5) focuses on the DATA 125 bit boundaries in generating the data samples VL0 . . . VLn. The next four signals represent four of the sampling signals S0 . . . S3. The sampling signals S4 . . . Sn−1 have been omitted in FIG. 11 to avoid overcrowding drawing.

In the example shown in FIG. 11, the first full DATA 125 bit is a “1.” At time t0-t3, low-to-high transitions. X0-X3 in respective sampling voltages S0-S3 occur in the vicinity of the beginning of the first full bit. The time between the sampling voltage transitions (i.e., time between, e.g., X0-X1) may, for example, be about 0.5 ns. In FIG. 6, the instantaneous values of the DATA 125 signal at times t0-t3, respectively, are 0001. The transitions X0-X3 cause these instantaneous values to be loaded into the respective flip-flops 400 a-400 d so that data samples VL0-VL3 respectively provide 0001 during the first sampling period wherein each sampling period has a time length set at, for example, about 8.0 ns. The sampling period time length can be programmed by a circuit that uses the bin size to determine the sampling period time length.

The second full DATA 125 bit in FIG. 11 is a “0.” In the vicinity of the beginning of this second-full bit, the sampling signals S0-S3 respectively make low-to-high transitions X0′-X3′ at times t0′-t3′. The time between the sampling voltage transitions (e.g., time between X0′-X1′) may, for example, be about 0.5 ns. The instantaneous values of the DATA 125 signal respectively are 1100 at times t0′-t3′ in the illustrated example. The sampling performed with the sampling signals S0-S3 at transitions X0′-X3′ causes the data samples VL0-VL3 to be respectively provided as 1100 during the second sampling period.

As shown above, VL0 . . . VL1 will have values for each sampling period. Based on the VL0 . . . VLn values for each sampling period, the XOR gates 410 a . . . 410 n responsively output the signals Bin(0) . . . Bin(n−1), respectively. One of the signals Bin(0) . . . Bin(n−1) will have a “1” value to reflect the occurrence of a transition in the DATA 125 signal. For example, in FIG. 11, a DATA 125 transition occurs between t2 and t3. Thus, VL2 will be a “0” while VL3 will be a “1.” The XOR gate 410 c will thus output a Bin(2) signal with a value of “1.” Since transitions did not occur at other times, the signals Bin(0), Bin(1), and Bin(3) . . . Bin(n−1) will each have a value of “0”.

Reference is now made to FIGS. 12 and 13 to further discuss clock recovery based on edge sampling and weighted averaging. In the example of FIGS. 12 and 13, each of the bins BIN0 . . . BIN15 corresponds to a phase setting of the destination clock 145. It will be appreciated from the teachings of the present invention that the FIGS. 12 and 13 example can be modified to add additional bins. Thus, for a one-hundred megabit networking scheme, the bins BIN0 . . . BIN15 may, for example, be implemented. For a ten megabit networking scheme, BIN0 . . . BIN39 (i.e., 40 bins) may be implemented. For the one-hundred megabit networking scheme, each of the BIN0 . . . BIN15 is sized at 5 ns.

FIG. 13 is shown for defining each bin in the BIN0 . . . BIN15 configuration. Assume that the initial phase of the clock select 217 corresponds to BIN8, as represented by the arrow 700. A clock select 217 phase, which is positioned at BIN8, will have a Gaussian distribution represented by curve 705. As shown in FIG. 6, this Gaussian distribution is measured by the logic elements of the edge counter and sum accumulator 210.

The counter/accumulator 210 detects the transitions (edges) occurring in the DATA 125 signal (FIG. 11) for every sampling period of 8.0 ns. Each edge occurrence is then recorded and statistically gathered by a corresponding bin which functions as a statistical counter. The time (within the 8.0 ns sampling period) in which the edge occurs determines which of the BIN0 . . . BIN15 records the edge occurrence. Each of the bins BIN0 . . . BIN15 defines, for example, a 0.5 ns time frame. The sum of all bins BIN0 . . . BIN15 time frames equals the 8.0 ns sampling period. Thus, if a bit edge occurs within the first 0.5 ns, then BIN0 will accordingly record this edge. As shown in FIGS. 5 and 11, if a DATA 125 transition occurs between t2 and t3, then the sampling flip-flops 400 a . . . 400 n are able to record this transition occurrence. Accordingly, the Bin(2) signal will be a “1” in response to the transition occurrence between t2 and t3. This Bin(2) value of “1” is then statistically gathered by BIN2. Similarly, if a DATA 125 edge transition occurs at another time different from the t2-t3 frame, then one of the Bin(0) . . . Bin(n−1) will appropriately have a “1” value which is recorded by a bin corresponding to the time frame in which the edge transition occurred.

In the example shown in FIG. 12, if BIN8 is assumed to correspond to the initial phase of the clock select 217, then the following bins are assigned corresponding values: BIN0=−8, BIN1=−7, BIN2=−6, BIN3=−5, BIN4=−4, BIN5=−3, BIN6=−2, BIN7=−1, BIN8=0, BIN9=1, BIN10=2, BIN11=3, BIN12=4, BIN13=5, BIN14=6, and BIN15=7. It follows from the teachings of this invention that the above bin values will differ if the initial phase of the clock select 217 corresponds to a different bin (e.g., BIN9). Thus, if the clock select 217 is set at an initial phase corresponding to BIN9, then the BIN9 value would be set equal to “0.”

The invention will detect and record (via BIN0 . . . BIN15) all edges occurring within a decision period of a programmable time length. For example, for the sixteen (16) bin configuration of FIG. 12, the decision period may be set to 314 bit times wherein each bit time is 8.0 ns long. Thus, the decision period may vary depending on the networking scheme used and on design requirements. The decision period time length is preferably set such that sufficient edge occurrences are recorded by the bins, thereby permitting the calculated weighted average to accurately reflect the edge distribution in a data stream 125.

FIG. 12 shows an example of edges occurring within a decision period of 314 bit times for the one hundred megabit networking scheme. Assume that the edges are recorded by the bins BIN0, BIN8, and BIN12. These edge occurrences are represented in FIG. 12 as arrows labeled “EDGE.” As stated above, the bins BIN0 . . . BIN15 will record edge occurrences based on which of the Bin(0) . . . Bin(15) signals have a value of “1.” A weighted average value can be calculated based on equation (1) and, as shown below, used for adjusting the clock select 217 phase setting to permit proper data recovery.

 weighted average=(weighted swum)/(number of edges)  (1)

The parameter “weighted sum” is the sum of the values of the bins that record edge occurrences in the DATA 125 signal during a decision period. The parameter “number of edges” is the sum of the number of edges of the DATA 125 signal which occur within the decision period. In the example of FIG. 12, the weighted sum is given by equation (2).

weighted sum=(BIN0 value)+(BIN8 value)+(BIN12 value)=−8+0+4=−4  (2)

The number of edges which occurred during the decision period is three (3), as represented by the arrows labeled “edges.” Thus according to equation (1), the weighted average is calculated as shown in equation (3).

weighted average=−{fraction (4/3)}=−1.33  (3)

The weighted average value of −1.33 in equation (3) instructs the decision circuit 215 to move the clock select 217 phase setting at minus one (−1) bin positions after the end of the decision period, assuming the PPM difference between the source clock 114 and the destination clock 145 is about 100 parts-per-million (PPM). As noted, the minus one (−1) value corresponds to the rounded value of −1.33. Thus, in the FIG. 12 example, the initial phase setting of the clock select 217 corresponds to BIN8. Based on the weighted average value of −1.33, the decision circuit 215 will move the clock select 217 phase setting to minus one (−1) bin positions after the decision period. Thus, the clock select 217 phase setting will move from BIN8 to BIN7. The new destination clock 145 phase is represented by arrow 710 and by the dashed Gaussian distribution 715.

As a further example, assume the weighted average value of equation (1) is calculated to equal a rounded value of +1 after a decision period. The clock select 217 phase position will then move from its initial position of BIN8 to BIN9 after the decision period. This new clock select 217 phase is represented by arrow 720 and by the dashed Gaussian distribution 725.

As an additional example, assume the weighted average value of equation (1) is calculated to equal a rounded value of “0” after a decision period. The clock select 217 phase position will therefore not move from its initial position of BIN8 (as represented by arrow 700) after the decision period.

Reference is now made to FIG. 14, which shows a DATA signal 125 for further illustrating the method of sampling based on weighted averaging. The DATA signal 125 of FIG. 14 has NRZI encoding and a period T of, for example, about 8.0 ns. As stated above, however, the DATA signal 125 can have other forms of encoding such as Manchester encoding. Ideally, the clock select phase setting is set such that sampling can occur in the bit midstream (as best shown by arrows 800). The bins BIN0 . . . BIN15 (FIG. 12) will record the transitions 805 of the DATA signal 125 for a decision period and the counter/accumulator 210 will calculate the weighted average value based on the above equation (1). Assuming an ideal condition exist wherein jitter is absent in the DATA signal 125, the weighted average calculation leads to a clock select 217 phase setting which corresponds to the bit midstream position 800. Ideal data recovery is achieved by sampling in the bit midstream position 800.

An advantage provided by the invention is illustrated by the example of FIG. 15. Jitter may occur in the DATA signal 125 causing a bit (represented by dashed lines 845) to shift in the direction of arrow 850. The bins BIN0 . . . BIN15 will record the transitions 805′ of the jittered bit 845, as well as transitions of other bits without jitter. The calculated weighted average value (determined by equation (1)) takes into account the bit distributions of the DATA signal 125 and maintain sampling at the bit midstream position 800. In contrast, a PLL in a conventional clock/data recovery system may lock onto a jittered bit 845 and accordingly adjust its phase based on the locked jittered bit. This results in an out-of-phase misalignment between the data recovery mechanism and the recovered data.

Thus, while the present invention has been described herein with reference to particular embodiments, it will be appreciated that some features of the invention can be employed without a corresponding use of other features and without departing from the scope of the invention. 

What is claimed is:
 1. A shared data and clock recovery circuit comprising: a clock synthesizer adapted to generate a plurality of sampling signals having different phases; a multiple transition detector adapted to receive a packetized data stream and said plurality of sampling signals, and detect edges in said data stream in response to said sampling signals; a counter/accumulator adapted to detect the time occurrences and total number of said edges, perform a weighted averaging calculation, and output a signal related to said weighted averaging calculation to select one of said different phases; a decision circuit adapted to acquire lock onto the packetized data stream; and a gain control circuit adapted to use the time occurrences detected by the counter/accumulator to control the progressive acquisition of lock, wherein the gain control circuit contains N number of stages progressively refining the lock position.
 2. A shared data and clock recovery circuit comprising: a clock synthesizer having a plurality of sampling signals having different phases; a multiple transition detector adapted to receive a data stream and said plurality of sampling signals and generate a plurality of output signals corresponding to edges detected in said data stream in response to said sampling signals; a counter/accumulator adapted to receive said plurality of output signals, accumulate the time differences represented by said plurality of output signals and total number of said edges detected, perform weighted average calculations to select one of said different phases, and produce an output signal; and a gain control circuit adapted to use the time differences detected by the counter/accumulator to control the progressive acquisition of lock, wherein the gain control circuit contains N number of stages progressively refining the lock position.
 3. The shared data and clock recovery circuit of claim 2 wherein each stage contains a decision period where the decision period can be either in number of bit times or number of edges.
 4. The shared data and clock recovery circuit of claim 2 wherein each stage contains a step size.
 5. The shared data and clock recovery circuit of claim 2 wherein each stage contains an iteration count.
 6. The shared data and clock recovery circuit of claim 2 including a zero phase start-up stage.
 7. The shared data and clock recovery circuit of claim 2 wherein each stage controls whether the computation of time deltas is based on a folded or non-folded window.
 8. The shared data and clock recovery circuit of claim 2 wherein the shared data and clock recovery circuit is adapted to operate using a folded sampling window.
 9. The shared data and clock recovery circuit of claim 8 wherein full window system results can be achieved with a folded window system.
 10. The shared data and clock recovery circuit of claim 2 including an accumulator block adapted to take bin information from the multiple transition detector and compute either a folded or non-folded weight.
 11. The shared data and clock recovery circuit of claim 10 wherein the accumulator block is further adapted to a zero phase start-up position.
 12. The shared data and clock recovery circuit of claim 1, wherein at least two of the stages have independent parameters.
 13. The shared data and clock recovery circuit of claim 2, wherein at least two of the stages have independent parameters.
 14. A shared data and clock recovery circuit comprising: a clock synthesizer adapted to generate a plurality of sampling signals having different phases; a multiple transition detector adapted to receive a packetized data stream and said plurality of sampling signals, and detect edges in said data stream in response to said sampling signals; a counter/accumulator adapted to detect the time occurrences and total number of said edges, perform a weighted averaging calculation, and output a signal related to said weighted averaging calculation to select one of said different phases; and a decision circuit adapted to acquire lock onto the packetized data stream, wherein the shared data and clock recovery circuit is adapted to operate using either a folded or non-folded window, wherein: when the shared data and clock recovery circuit is operated using a folded window, the number of bins used, amount of circuitry used, and power are reduced.
 15. A shared data and clock recovery circuit comprising: a clock synthesizer having a plurality of sampling signals having different phases; a multiple transition detector adapted to receive a data stream and said plurality of sampling signals and generate a plurality of output signals corresponding to edges detected in said data stream in response to said sampling signals; a counter/accumulator adapted to receive said plurality of output signals, accumulate the time differences represented by said plurality of output signals and total number of said edges detected, and performing weighted average calculations to select one of said different phases, and produce an output signal; a gain control circuit adapted to use the time differences detected by the counter/accumulator to control the progressive acquisition of lock, wherein the shared data and clock recovery circuit is adapted to operate using either a folded or non-folded window; and an accumulator block adapted to take bin information from the multiple transition circuit and compute either a folded or non-folded weight.
 16. The shared data and clock recovery circuit of claim 15, wherein the accumulator block is further adapted to compute zero-phase start-up position.
 17. The shared data and clock recovery circuit of claim 15, wherein, when the shared data and clock recovery circuit is operated using a folded window, the number of bins used, amount of circuitry used, and power are reduced.
 18. A shared data and clock recovery circuit comprising: a clock synthesizer adapted to generate a plurality of sampling signals having different phases; a multiple transition detector adapted to receive a packetized data stream and said plurality of sampling signals, and detect edges in said data stream in response to said sampling signals; a counter/accumulator adapted to detect the time occurrences and total number of said edges, perform a weighted averaging calculation, and output a signal related to said weighted averaging calculation to select one of said different phases; a decision circuit adapted to acquire lock onto the packetized data stream; and a gain control circuit adapted to use the total number of edges detected by the counter/accumulator to control the progressive acquisition of lock, wherein the gain control circuit contains N number of stages progressively refining the lock position.
 19. A shared data and clock recovery circuit comprising: a clock synthesizer having a plurality of sampling signals having different phases; a multiple transition detector adapted to receive a data stream and said plurality of sampling signals and generate a plurality of output signals corresponding to edges detected in said data stream in response to said sampling signals; a counter/accumulator adapted to receive said plurality of output signals, accumulate the time differences represented by said plurality of output signals and total number of said edges detected, and performing weighted average calculations to select one of said different phases, and produce an output signal; and a gain control circuit adapted to use the time differences detected by the counter/accumulator to control the progressive acquisition of lock, wherein the shared data and clock recovery circuit is adapted to operate using either a folded or non-folded window, wherein: when the shared data and clock recovery circuit is operated using a folded window, the number of bins used, amount of circuitry used, and power are reduced.
 20. The shared data and clock recovery circuit of claim 19, wherein the accumulator block is further adapted to compute a zero-phase start-up position. 